#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <unistd.h>
#include <string.h>

struct context {
  int char_col;
  int text_index;
  char *text;
  int vram_disp_pos;  /* the pattern column on first display column */
  int cumulated_width;
};

static void render_one_column (struct context *, int scroll_mode);

#define TIMEOUT 100
#define DIS_WIDTH 15  /* width of the 'canvas' */
int
main (int argc, char *argv[])
{
  char *text_to_be_rendered;
  struct context context = { 0, 0, NULL, 0, 0};
  int scroll_mode = 0;

  if (argc == 1)
    text_to_be_rendered = "hello";
  else if (argc == 2)
    text_to_be_rendered = argv[1];
  else if (argc == 3)
    {
      text_to_be_rendered = argv[1];
      scroll_mode = atoi(argv[2]);
    }
  else
    {
      printf ("Usage: %s [text] [scrollmode]\n", argv[0]);
      exit (1);
    }

  context.text = text_to_be_rendered;

  while (1)
    {
      struct pollfd pfd = { 0 /* standard input */, POLLIN, 0 };
      int r;

      /* Any input stops this program */
      if ((r = poll (&pfd, 1, TIMEOUT)) < 0)
	{
	  perror ("poll\n");
	  exit (1);
	}

      if (r)
	break;

      render_one_column (&context, scroll_mode);
    }

  /* dummy read */
#define BUFSIZE 256

  {
    char buf[BUFSIZE];

    read (0, buf, BUFSIZE);
  }

  return 0;
}
static int
absolute(int a)
{
  if(a>=0)
    return a;
  else
    return -a;
}

/* forward declaration*/
static unsigned char etl_font_data[];

#define MIN_CHAR 0x20
#define MAX_CHAR 0x7e
#define FIX_WIDTH 8

static int char_width (unsigned char c)
{
  return FIX_WIDTH;
}

static unsigned char *char_bits (unsigned char c)
{
  if (c < MIN_CHAR || c > MAX_CHAR)
    return NULL;
  else
    return &etl_font_data[(c - MIN_CHAR)*FIX_WIDTH*2];
}
static int
cumulated_width(struct context *ctx)
{
  int i, j;
  int total;

  /* first we sum up the width of all completed chars,
   * then substract the vram_disp_pos */
  for(i = 0, total = 0; i < ctx->text_index; i++){
      j = ctx->text[i];
      total+= char_width(j);
  }
  total+= ctx->char_col;

  total-=ctx->vram_disp_pos;

  return 0;
}
/* this sets the displaying mode in terms of:
 * scrolling left/scrolling right/static. speed of scrolling
 * is also an option
 *
 * i don't know about this..
 */
static void
rewind_patt(struct context *ctx, int whereto)
{
  int i;
  int total;

  /* whereto defines the column number to which we're
   * rewinding
   */
  if (!whereto)
    {
      ctx->char_col = 0;
      ctx->text_index = 0;
    }
  else
    {
      for(i = 0; i< strlen(ctx->text); i++)
	{
	  total+= char_width(ctx->text[i]);
	  if (total >= ctx->vram_disp_pos)
	    break;
	}
      total-= char_width(ctx->text[i]);
      
      ctx->char_col = (whereto - total);
      ctx->text_index = i;

    }
  
  ctx->cumulated_width = 0;

  return;
}
static void
shift_right(struct context *ctx, int speed)
{
  char c;
  ctx->char_col++;

  c = ctx->text[ctx->text_index];
  if (ctx->char_col >= char_width(c))
    {
      ctx->char_col = 0;
      ctx->text_index++;
      
      if (ctx->text[ctx->text_index] == '\0')
	ctx->text_index = 0;
    }

  return;
}
static void
shift_left(struct context *ctx, int speed)
{
  char c;
  ctx->char_col--;

  c = ctx->text[ctx->text_index];
  if (ctx->char_col <= 0)
    {
      if (ctx->text_index <= 0)
	{
	  ctx->text_index = strlen (ctx->text) - 1;
	  c = ctx->text[ctx->text_index];
	  ctx->char_col = char_width(c)-1;
	}
      else
	{
	  ctx->text_index--;
	  c = ctx->text[ctx->text_index];
	  ctx->char_col = char_width(c)-1;
	}
    }

  return;
}
static void
render_one_column (struct context *ctx, int scroll_mode)
{
  int col, index;
  unsigned char c;
  unsigned char *bits;
  int len;

  ctx->cumulated_width++;
  if (ctx->cumulated_width >= DIS_WIDTH)
    {
      printf("#########\n");
      /* scroll mode's absolute value determines speed of scrolling */
      if (scroll_mode == 0)
	{
	  rewind_patt(ctx, 0);
	}
	if (scroll_mode < 0)
	  {
	  rewind_patt(ctx, ++ctx->vram_disp_pos); 
	  shift_right(ctx, absolute(scroll_mode));
	}
      if (scroll_mode > 0)
	{
	  rewind_patt(ctx, ++ctx->vram_disp_pos); 
	  shift_left(ctx, absolute(scroll_mode));
	}
    }
  col = ctx->char_col++;

  /* this can probably be also moved to shift_right */ 
  c = ctx->text[ctx->text_index];
  if (ctx->char_col >= char_width(c))
    {
      ctx->char_col = 0;
      index = ctx->text_index++;
      if (ctx->text[ctx->text_index] == '\0')
	ctx->text_index = 0;
    }
  else
    index = ctx->text_index;

  /* character to be displayed */
  len = char_width (c);
  bits = char_bits (c);

  if (bits != NULL)
    {
      unsigned char bits1, bits2;
      int i;

      bits1 = bits[col*2];
      bits2 = bits[col*2+1];

      for (i = 7; i >= 0; i--)
	putchar ((bits1 & (1<<i))?'*': ' ');

      for (i = 7; i >= 0; i--)
	putchar ((bits2 & (1<<i))?'*': ' ');

      putchar ('\n');
    }
}

/* Font data taken from ETL intl fonts */
static unsigned char etl_font_data[] = { /* 0x20 to 0x7e */
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x33, 0xf8,
  0x33, 0xf8,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x16,
  0x00, 0x1e,
  0x00, 0x0e,
  0x00, 0x00,
  0x00, 0x16,
  0x00, 0x1e,
  0x00, 0x0e,
  0x00, 0x00,
  0x1e, 0x40,
  0x1f, 0xc0,
  0x03, 0xf8,
  0x1e, 0x78,
  0x1f, 0xc0,
  0x03, 0xf8,
  0x02, 0x78,
  0x00, 0x00,
  0x04, 0x60,
  0x08, 0x90,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x09, 0x10,
  0x0f, 0x10,
  0x06, 0x20,
  0x00, 0x00,
  0x18, 0x30,
  0x0e, 0x78,
  0x07, 0x48,
  0x1f, 0xf8,
  0x12, 0xe0,
  0x1e, 0x70,
  0x0c, 0x18,
  0x00, 0x00,
  0x0e, 0x00,
  0x1f, 0x70,
  0x11, 0xf8,
  0x11, 0x88,
  0x1b, 0x88,
  0x0e, 0xf8,
  0x1b, 0x70,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x16,
  0x00, 0x1e,
  0x00, 0x0e,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x07, 0xe0,
  0x1f, 0xf8,
  0x38, 0x1c,
  0x20, 0x04,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x20, 0x04,
  0x38, 0x1c,
  0x1f, 0xf8,
  0x07, 0xe0,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x0c, 0x60,
  0x06, 0xc0,
  0x03, 0x80,
  0x0f, 0xe0,
  0x03, 0x80,
  0x06, 0xc0,
  0x0c, 0x60,
  0x00, 0x00,
  0x01, 0x00,
  0x01, 0x00,
  0x0f, 0xe0,
  0x0f, 0xe0,
  0x01, 0x00,
  0x01, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x58, 0x00,
  0x78, 0x00,
  0x38, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x01, 0x80,
  0x01, 0x80,
  0x01, 0x80,
  0x01, 0x80,
  0x01, 0x80,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x18, 0x00,
  0x18, 0x00,
  0x18, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x18, 0x00,
  0x1c, 0x00,
  0x07, 0x00,
  0x03, 0xc0,
  0x00, 0xe0,
  0x00, 0x38,
  0x00, 0x18,
  0x00, 0x00,
  0x07, 0xe0,
  0x0f, 0xf0,
  0x18, 0x18,
  0x10, 0x08,
  0x18, 0x18,
  0x0f, 0xf0,
  0x07, 0xe0,
  0x00, 0x00,
  0x00, 0x00,
  0x10, 0x20,
  0x10, 0x30,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x00,
  0x10, 0x00,
  0x00, 0x00,
  0x1c, 0x30,
  0x1e, 0x38,
  0x13, 0x08,
  0x11, 0x88,
  0x10, 0x88,
  0x10, 0xf8,
  0x10, 0x70,
  0x00, 0x00,
  0x0c, 0x30,
  0x1c, 0x38,
  0x10, 0x88,
  0x10, 0x88,
  0x10, 0x88,
  0x1f, 0xf8,
  0x0f, 0x70,
  0x00, 0x00,
  0x03, 0x80,
  0x03, 0xc0,
  0x02, 0x60,
  0x02, 0x30,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x02, 0x00,
  0x00, 0x00,
  0x08, 0xf8,
  0x18, 0xf8,
  0x10, 0x88,
  0x10, 0x88,
  0x10, 0x88,
  0x1f, 0x88,
  0x0f, 0x08,
  0x00, 0x00,
  0x0f, 0xe0,
  0x1f, 0xf0,
  0x10, 0x98,
  0x10, 0x88,
  0x10, 0x88,
  0x1f, 0x88,
  0x0f, 0x00,
  0x00, 0x00,
  0x00, 0x08,
  0x00, 0x08,
  0x00, 0x08,
  0x1e, 0x08,
  0x1f, 0xc8,
  0x01, 0xf8,
  0x00, 0x38,
  0x00, 0x00,
  0x0f, 0x70,
  0x1f, 0xf8,
  0x10, 0x88,
  0x10, 0x88,
  0x10, 0x88,
  0x1f, 0xf8,
  0x0f, 0x70,
  0x00, 0x00,
  0x00, 0x70,
  0x10, 0xf8,
  0x10, 0x88,
  0x10, 0x88,
  0x18, 0x88,
  0x0f, 0xf8,
  0x07, 0xf0,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x0c, 0x60,
  0x0c, 0x60,
  0x0c, 0x60,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x2c, 0x60,
  0x3c, 0x60,
  0x1c, 0x60,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x01, 0x00,
  0x03, 0x80,
  0x06, 0xc0,
  0x0c, 0x60,
  0x18, 0x30,
  0x10, 0x10,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x0c, 0xc0,
  0x0c, 0xc0,
  0x0c, 0xc0,
  0x0c, 0xc0,
  0x0c, 0xc0,
  0x00, 0x00,
  0x00, 0x00,
  0x10, 0x10,
  0x18, 0x30,
  0x0c, 0x60,
  0x06, 0xc0,
  0x03, 0x80,
  0x01, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x30,
  0x00, 0x38,
  0x33, 0x08,
  0x33, 0x88,
  0x00, 0xf8,
  0x00, 0x70,
  0x00, 0x00,
  0x00, 0x00,
  0x07, 0xe0,
  0x0f, 0xf0,
  0x18, 0x18,
  0x17, 0xc8,
  0x14, 0x58,
  0x17, 0xf0,
  0x07, 0xe0,
  0x00, 0x00,
  0x1f, 0xe0,
  0x1f, 0xf0,
  0x01, 0x18,
  0x01, 0x08,
  0x01, 0x18,
  0x1f, 0xf0,
  0x1f, 0xe0,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x88,
  0x10, 0x88,
  0x10, 0x88,
  0x1f, 0xf8,
  0x0f, 0x70,
  0x00, 0x00,
  0x0f, 0xf0,
  0x1f, 0xf8,
  0x10, 0x08,
  0x10, 0x08,
  0x10, 0x08,
  0x1c, 0x38,
  0x0c, 0x30,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x08,
  0x10, 0x08,
  0x08, 0x10,
  0x0f, 0xf0,
  0x07, 0xe0,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x88,
  0x10, 0x88,
  0x10, 0x88,
  0x10, 0x88,
  0x10, 0x08,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x88,
  0x00, 0x88,
  0x00, 0x88,
  0x00, 0x88,
  0x00, 0x08,
  0x00, 0x00,
  0x0f, 0xf0,
  0x1f, 0xf8,
  0x10, 0x08,
  0x11, 0x08,
  0x09, 0x08,
  0x1f, 0x38,
  0x1f, 0x30,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x80,
  0x00, 0x80,
  0x00, 0x80,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x00,
  0x10, 0x08,
  0x10, 0x08,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x08,
  0x10, 0x08,
  0x00, 0x00,
  0x00, 0x00,
  0x0c, 0x00,
  0x1c, 0x00,
  0x10, 0x08,
  0x10, 0x08,
  0x1f, 0xf8,
  0x0f, 0xf8,
  0x00, 0x08,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x03, 0xc0,
  0x06, 0x60,
  0x0c, 0x30,
  0x18, 0x18,
  0x10, 0x08,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x00,
  0x10, 0x00,
  0x10, 0x00,
  0x10, 0x00,
  0x10, 0x00,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x70,
  0x03, 0xe0,
  0x00, 0x70,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x60,
  0x01, 0x80,
  0x06, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x00,
  0x0f, 0xf0,
  0x1f, 0xf8,
  0x10, 0x08,
  0x10, 0x08,
  0x10, 0x08,
  0x1f, 0xf8,
  0x0f, 0xf0,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x88,
  0x00, 0x88,
  0x00, 0x88,
  0x00, 0xf8,
  0x00, 0x70,
  0x00, 0x00,
  0x0f, 0xf0,
  0x1f, 0xf8,
  0x14, 0x08,
  0x14, 0x08,
  0x18, 0x08,
  0x3f, 0xf8,
  0x2f, 0xf0,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x01, 0x88,
  0x03, 0x88,
  0x06, 0x88,
  0x0c, 0xf8,
  0x18, 0x70,
  0x00, 0x00,
  0x0c, 0x70,
  0x1c, 0xf8,
  0x10, 0x88,
  0x11, 0x88,
  0x11, 0x08,
  0x1f, 0x38,
  0x0e, 0x30,
  0x00, 0x00,
  0x00, 0x08,
  0x00, 0x08,
  0x00, 0x08,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x08,
  0x00, 0x08,
  0x00, 0x00,
  0x0f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x00,
  0x10, 0x00,
  0x10, 0x00,
  0x1f, 0xf8,
  0x0f, 0xf8,
  0x00, 0x00,
  0x00, 0x38,
  0x01, 0xe0,
  0x0f, 0x80,
  0x1e, 0x00,
  0x07, 0xc0,
  0x01, 0xf8,
  0x00, 0x38,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x0c, 0x00,
  0x07, 0x80,
  0x0c, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x00, 0x00,
  0x18, 0x18,
  0x0e, 0x78,
  0x03, 0xe0,
  0x01, 0x80,
  0x07, 0xc0,
  0x1e, 0x70,
  0x18, 0x18,
  0x00, 0x00,
  0x00, 0x38,
  0x00, 0xe0,
  0x1f, 0x80,
  0x1f, 0x80,
  0x00, 0xe0,
  0x00, 0x78,
  0x00, 0x18,
  0x00, 0x00,
  0x18, 0x08,
  0x1c, 0x08,
  0x17, 0x08,
  0x13, 0x88,
  0x10, 0xe8,
  0x10, 0x78,
  0x10, 0x18,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x3f, 0xfc,
  0x3f, 0xfc,
  0x20, 0x04,
  0x20, 0x04,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x18,
  0x00, 0x38,
  0x00, 0xe0,
  0x03, 0xc0,
  0x07, 0x00,
  0x1c, 0x00,
  0x18, 0x00,
  0x00, 0x00,
  0x20, 0x04,
  0x20, 0x04,
  0x3f, 0xfc,
  0x3f, 0xfc,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x08,
  0x00, 0x0c,
  0x00, 0x06,
  0x00, 0x06,
  0x00, 0x0c,
  0x00, 0x08,
  0x00, 0x00,
  0x00, 0x00,
  0x30, 0x00,
  0x30, 0x00,
  0x30, 0x00,
  0x30, 0x00,
  0x30, 0x00,
  0x30, 0x00,
  0x30, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x0e,
  0x00, 0x1e,
  0x00, 0x16,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x0e, 0x40,
  0x1f, 0x60,
  0x11, 0x20,
  0x11, 0x20,
  0x09, 0x20,
  0x1f, 0xe0,
  0x1f, 0xc0,
  0x00, 0x00,
  0x1f, 0xfc,
  0x1f, 0xfc,
  0x08, 0x40,
  0x10, 0x20,
  0x10, 0x20,
  0x1f, 0xe0,
  0x0f, 0xc0,
  0x00, 0x00,
  0x0f, 0xc0,
  0x1f, 0xe0,
  0x10, 0x20,
  0x10, 0x20,
  0x10, 0x20,
  0x18, 0x60,
  0x08, 0x40,
  0x00, 0x00,
  0x0f, 0xc0,
  0x1f, 0xe0,
  0x10, 0x20,
  0x10, 0x20,
  0x08, 0x40,
  0x1f, 0xfc,
  0x1f, 0xfc,
  0x00, 0x00,
  0x0f, 0xc0,
  0x1f, 0xe0,
  0x11, 0x20,
  0x11, 0x20,
  0x11, 0x20,
  0x19, 0xe0,
  0x09, 0xc0,
  0x00, 0x00,
  0x00, 0x40,
  0x00, 0x40,
  0x1f, 0xf8,
  0x1f, 0xfc,
  0x00, 0x44,
  0x00, 0x44,
  0x00, 0x00,
  0x00, 0x00,
  0x31, 0xc0,
  0x7f, 0xe0,
  0x4e, 0x20,
  0x4a, 0x20,
  0x4b, 0xe0,
  0x79, 0xf0,
  0x30, 0x30,
  0x00, 0x00,
  0x1f, 0xfc,
  0x1f, 0xfc,
  0x00, 0x40,
  0x00, 0x20,
  0x00, 0x20,
  0x1f, 0xe0,
  0x1f, 0xc0,
  0x00, 0x00,
  0x10, 0x00,
  0x10, 0x20,
  0x1f, 0xec,
  0x1f, 0xec,
  0x10, 0x00,
  0x10, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x20, 0x00,
  0x60, 0x00,
  0x40, 0x00,
  0x60, 0x20,
  0x3f, 0xec,
  0x1f, 0xec,
  0x00, 0x00,
  0x00, 0x00,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x03, 0x80,
  0x06, 0xc0,
  0x0c, 0x60,
  0x18, 0x20,
  0x10, 0x00,
  0x00, 0x00,
  0x10, 0x00,
  0x10, 0x08,
  0x1f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x00,
  0x10, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x1f, 0xe0,
  0x1f, 0xe0,
  0x00, 0x60,
  0x03, 0xc0,
  0x00, 0x60,
  0x1f, 0xe0,
  0x1f, 0xc0,
  0x00, 0x00,
  0x1f, 0xe0,
  0x1f, 0xe0,
  0x00, 0x40,
  0x00, 0x20,
  0x00, 0x20,
  0x1f, 0xe0,
  0x1f, 0xc0,
  0x00, 0x00,
  0x0f, 0xc0,
  0x1f, 0xe0,
  0x10, 0x20,
  0x10, 0x20,
  0x10, 0x20,
  0x1f, 0xe0,
  0x0f, 0xc0,
  0x00, 0x00,
  0x7f, 0xe0,
  0x7f, 0xe0,
  0x08, 0x40,
  0x10, 0x20,
  0x10, 0x20,
  0x1f, 0xe0,
  0x0f, 0xc0,
  0x00, 0x00,
  0x0f, 0xc0,
  0x1f, 0xe0,
  0x10, 0x20,
  0x10, 0x20,
  0x08, 0x40,
  0x7f, 0xe0,
  0x7f, 0xe0,
  0x00, 0x00,
  0x1f, 0xe0,
  0x1f, 0xe0,
  0x00, 0x40,
  0x00, 0x20,
  0x00, 0x20,
  0x00, 0xe0,
  0x00, 0xc0,
  0x00, 0x00,
  0x08, 0xc0,
  0x19, 0xe0,
  0x11, 0x20,
  0x13, 0x20,
  0x12, 0x20,
  0x1e, 0x60,
  0x0c, 0x40,
  0x00, 0x00,
  0x00, 0x20,
  0x00, 0x20,
  0x0f, 0xf8,
  0x1f, 0xf8,
  0x10, 0x20,
  0x10, 0x20,
  0x00, 0x00,
  0x00, 0x00,
  0x0f, 0xe0,
  0x1f, 0xe0,
  0x10, 0x00,
  0x10, 0x00,
  0x08, 0x00,
  0x1f, 0xe0,
  0x1f, 0xe0,
  0x00, 0x00,
  0x00, 0xe0,
  0x07, 0xe0,
  0x1f, 0x00,
  0x18, 0x00,
  0x1f, 0x00,
  0x07, 0xe0,
  0x00, 0xe0,
  0x00, 0x00,
  0x0f, 0xe0,
  0x1f, 0xe0,
  0x18, 0x00,
  0x0f, 0x00,
  0x18, 0x00,
  0x1f, 0xe0,
  0x0f, 0xe0,
  0x00, 0x00,
  0x18, 0x60,
  0x1c, 0xe0,
  0x07, 0x80,
  0x03, 0x00,
  0x07, 0x80,
  0x1c, 0xe0,
  0x18, 0x60,
  0x00, 0x00,
  0x03, 0xe0,
  0x47, 0xe0,
  0x4c, 0x00,
  0x48, 0x00,
  0x4c, 0x00,
  0x7f, 0xe0,
  0x3f, 0xe0,
  0x00, 0x00,
  0x18, 0x20,
  0x1c, 0x20,
  0x16, 0x20,
  0x13, 0x20,
  0x11, 0xa0,
  0x10, 0xe0,
  0x10, 0x60,
  0x00, 0x00,
  0x00, 0x00,
  0x19, 0x98,
  0x3f, 0xfc,
  0x26, 0x64,
  0x20, 0x04,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x7f, 0xfe,
  0x7f, 0xfe,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x20, 0x04,
  0x26, 0x64,
  0x3f, 0xfc,
  0x19, 0x98,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x00,
  0x00, 0x18,
  0x00, 0x1c,
  0x00, 0x04,
  0x00, 0x1c,
  0x00, 0x10,
  0x00, 0x1c,
  0x00, 0x0c,
  0x00, 0x00,
};
